﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ledict.ConditionExtract.DAL;
using Ledict.ConditionExtract.Common;


namespace Ledict.ConditionExtract.BLL
{
    public class ProcessDataSourceBLL
    {

        ProcessDataSourceDAL datas = new ProcessDataSourceDAL();

        public DataTable GetParaLogicByCaseId(DataSourceCondition conditon, string CaseId)
        {
            return datas.GetParaLogicByCaseId(conditon, CaseId);
        }
        public DataTable GetDataSource(DataSourceCondition conditon)//案由ID
        {
            return datas.GetDataSource(conditon);
        }
        public DataTable GetParagraphLogic(DataSourceCondition conditon)//案由ID
        {
            return datas.GetParagraphLogic(conditon);
        }

        public DataTable GetParagraphLogic_Page(DataSourceCondition conditon, int page, int pageSize, out int totalNum)//案由ID
        {
            return datas.GetParagraphLogic_Page(conditon, page, pageSize, out totalNum);
        }

        /// <summary>
        /// 获取逻辑段内容
        /// </summary>
        /// <param name="conditon"></param>
        /// <returns></returns>
        public DataTable GetParagraphLogic_PageNew(DataSourceCondition conditon)
        {
            return datas.GetParagraphLogic_PageNew(conditon);
        }


        public DataTable GetDataSource_Second(string situation)//案由ID
        {
            return datas.GetDataSource_Second(situation);
        }

        public DataTable GetDataSource_WrongOrder(string Situations, int Isdelete)//案由ID
        {
            return datas.GetDataSource_WrongOrder(Situations, Isdelete);
        }

        public DataTable GetDataSourceAllCaseCause()//案由ID
        {
            return datas.GetDataSourceAllCaseCause();
        }
        public int GetDataSourceAllCount(DataSourceCondition conditon)//案由ID
        {
            return datas.GetDataSourceAllCount(conditon);
        }


        public string ExceptAdditionalFields(string caseid)
        {
            return datas.ExceptAdditionalFields(caseid);
        }



        public DataTable GetCauseDataSource(string pid)//案由ID
        {
            return datas.GetCauseDataSource(pid);
        }

        public DataTable GetCauseDataSource(string pid, string purposeId, string paragraphId, bool isCurrentId = false)
        {
            return datas.GetCauseDataSource(pid, purposeId, paragraphId, isCurrentId);
        }

        //public DataTable GetAllRelationCC_ID(string Situation)//案由ID
        //{
        //    return datas.GetAllRelationCC_ID(Situation);

        //}

        #region 索引ID记录

        public bool Existsluceneid(string id, string CaseCauseID)
        {
            return datas.Existsluceneid(id, CaseCauseID);
        }

        public bool UpdateDataState(string id, string CaseCauseID)
        {
            return datas.UpdateDataState(id, CaseCauseID);
        }

        #endregion

    }
}
